// 文字选中颜色
::selection {
  background: $color-theme;
  color: $color-white;
}

// 滚动条颜色
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: #e4e4e4;
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: $color-theme;
  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
}

:root {
  // 间隙
  --small-gap: 8px;
  --base-gap: calc(var(--small-gap) * 2);
  --large-gap: calc(var(--base-gap) + var(--small-gap));
}

@media screen and (max-width: 768px) {
  :root {
    --small-gap: 5px;
  }
}

html,
body {
  &.h-f-100 {
    height: 100%;
    overflow: hidden;
  }
}

body {
  overflow-x: hidden;
  width: 100%;
  background-color: var(--color-main-background);
  font: $font-size-base "play", PingFangSC-Regular, Microsoft Yahei;
  line-height: $line-height-base;
  color: var(--color-primary);

  &.blank-page {
    background-color: var(--color-sub-background);
  }
}

.nuxt-link-exact-active {
  color: var(--color-theme);
}

// 表情
.wp-smiley {
  width: 20px !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  box-shadow: none !important;
}

.menu-mask {
  position: fixed;
  top: 60px;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: $color-mask;

  &.is-show-menu {
    z-index: $z-index;
    opacity: 1;
  }
}

// 翻页按钮
.main {
  transition: .5s;

  &.is-show-menu {
    transform: translateX(-240px);
  }

  .el-pagination {
    margin: 30px 0;
    text-align: center;

    li {
      border: 0;

      &:last-child {
        border: 0;
      }

      &.active,
      &:hover {
        background: none;
        color: var(--color-theme);
      }
    }

    .btn-next,
    .btn-prev {
      border: 0;
    }
  }
}

// 文章详情正文内容
.content-details {
  line-height: 2;
  $title-font-size: (
    1: 28px,
    2: 24px,
    3: 20px,
    4: 18px,
    5: 16px,
    6: 14px
  );
  @each $level, $size in $title-font-size {
    h#{$level} {
      margin: var(--large-gap) 0 calc(var(--base-gap) / 2);
      font-size: $size;
      line-height: $size + 8px;

      & + * {
        margin-top: 0 !important;
      }
    }
  }

  a {
    color: $color-theme;
  }

  img {
    height: auto !important;
    margin-top: var(--small-gap);
    vertical-align: baseline;

    &.wp-smiley {
      margin-top: 0;
    }
  }

  ul, ol {
    padding-left: 16px;
  }

  li {
    ul, ol, li {
      padding-left: 1em;
    }
  }
}

// 代码高亮
.code-toolbar {
  margin: var(--small-gap) 0 var(--base-gap);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  overflow: hidden;

  pre {
    margin: 0;

    &:after,
    &:before {
      display: none;
    }

    > code {
      border-left: 0;
      box-shadow: none;
    }
  }

  :not(pre) > code[class*=language-],
  pre[class*=language-] {
    background: none;
  }
}

// 鼠标点击特效
.move-dot-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  animation: move-dot .8s linear forwards;
}

@keyframes move-dot {
  to {
    opacity: 0;
    transform: translate3d(0, -80px, 0);
  }
}

@media screen and (max-width: 1200px) {
  .desktop-show {
    display: none;
  }

  .tablet-show {
    display: block;
  }

  .wrap {
    width: 94%;
  }

  // 文章列表
  .article-list-wrap,
  .container {
    .thumbnail-wrap {
      width: 260px;
      margin-right: 15px;
    }
  }
}

@media screen and (max-width: 768px) {
  .phone-show {
    display: block;
  }

  .phone-hide {
    display: none;
  }

  .article-list {
    .list-content {
      width: 100%;
      margin: 0;
    }
  }
}
